#include<QString>
#include<QAbstractItemModel>

class  AbstractList   //抽象数据列表类
{
   public:
    AbstractList(const QString &section);
    QString getSection() const;
    QString section_;
private:

};

class AbstractListModel : public  QAbstractListModel
{
    Q_OBJECT
public:
    enum AbstractListRoles{
         SectionRole=Qt::UserRole+1,
    };                               //定义抽象类成员角色
    AbstractListModel(QObject *parent=nullptr);
    void addList(const AbstractList &list);
    void clearList();
    void show();
    void remove();
    int rowCount(const QModelIndex &parent=QModelIndex()) const;  //返回给定父项行数
    QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const;//返回索引所在项给定角色的存储数据
protected:
    QHash<int,QByteArray> roleNames() const;  //返回模型的角色名
private:
    QList<AbstractList> m_abstractList;     //抽象列表类容器
};
